﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CurrencyCreator.ascx.cs"
    Inherits="CurrencyCreator" %>
<table>
    <tr>
        <td>
            <asp:Label ID="CurrencyNameLabel" runat="server" Text="Название валюты:" AssociatedControlID="CurrencyName"></asp:Label>
        </td>
        <td>
            <asp:TextBox ID="CurrencyName" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ControlToValidate="CurrencyName" CssClass="failureNotification"
                    Display="Dynamic" ID="CurrencyNameValidator" runat="server" ValidationGroup="CurrencyValidationGroup">*</asp:RequiredFieldValidator>
             <asp:RegularExpressionValidator ID="CurrencyNameValidator2" ControlToValidate="CurrencyName"
                    Text="Неправильное название валюты (XYZ)" ForeColor="Red" ValidationExpression="[A-Z]{3}"
                    runat="server" ValidationGroup="CurrencyValidationGroup" />
        </td>
       
    </tr>
    <tr>
        <td>
            <asp:Label ID="USDExchangeRateLabel" runat="server" Text="Курс доллара:" AssociatedControlID="USDExchangeRate"></asp:Label>
        </td>
        <td>
            <asp:TextBox MaxLength="8" ID="USDExchangeRate" runat="server"></asp:TextBox> 
             <asp:RequiredFieldValidator ControlToValidate="USDExchangeRate" CssClass="failureNotification"
                    Display="Dynamic" ID="CurrencyUSDValidator" runat="server" ValidationGroup="CurrencyValidationGroup">*</asp:RequiredFieldValidator>
            

            <asp:RegularExpressionValidator ID="CurrencyUSDValidator1" ControlToValidate="USDExchangeRate"
                    Text="Неправильный курс валюты (X / X,Y)" ForeColor="Red" ValidationExpression="(^\d*\,?\d*[1-9]+\d*$)|(^[1-9]+\d*\,\d*$)" 
                    runat="server" ValidationGroup="CurrencyValidationGroup" />
                    
       
              <%--       <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="USDExchangeRate"
                    Text="Неправильный курс валюты (X / X,Y)" ForeColor="Red" ValidationExpression="(^\d*\.?\d*[1-9]+\d*$)|(^[1-9]+\d*\.\d*$)" 
                    runat="server" ValidationGroup="CurrencyValidationGroup" />--%>
<%--
                    <asp:RangeValidator ID="USDExchangeRate2" runat="server" Text="Неверно задан курс"
                    ControlToValidate="USDExchangeRate" Type="Integer" ForeColor="Red" MinimumValue="1" MaximumValue="1000000" ValidationGroup="CurrencyValidationGroup"></asp:RangeValidator>--%>
        </td>
       
    </tr>
</table>
<p>
    <asp:Button ID="AddCurrency" runat="server" Text="Добавить валюту" OnClick="AddCurrency_Click"
        ValidationGroup="CurrencyValidationGroup" />
</p>
